<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		
		<script>
			"use strict"
			
			class Person{
				constructor(name, age){
					this.name = name
					this.age = age
				}
				
				showName(){
					console.log(this.name)
				}
			}
			
			let person = new Person("kobe", 39)
			console.log(person)
			person.showName()
			
			class StartPerson extends Person{
				constructor(name, age, salary){
					super(name, age);
					this.salary = salary
				}
				// 父类的方法重写
				showName(){
					console.log(this.name, this.salary)
				}
			}
			let p1 = new StartPerson("wade", 36, 10000)
			console.log(p1)
			p1.showName()
		</script>
	</body>
</html>
